<script lang="ts" setup>
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app';
import { useUserStore } from '@/stores/user';

onLaunch(() => {
  const { initData, login, getUserInfo, setUser } = useUserStore();
  login().then((res) => {
    getUserInfo(res.code).then((res) => {
      setUser(res);
    });
  });

  initData();

  wx.onAppRoute((res) => {
    console.log('跳转', res);
  });
});
onShow(() => {
  console.log('App Show');
});
onHide(() => {
  console.log('App Hide');
});
</script>
<style lang="scss">
@import 'uview-plus/index.scss';
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import '@/static/css/initialize.scss';
@import '@/static/css/index.scss';
@import '@/static/css/codeTheme.scss';
@import '@/static/iconfont/font.scss';

@layer components {
  .flex-center {
    @apply flex items-center justify-center;
  }
}
</style>
